package reservation.flight;


import reservation.flight.*;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainMenuActivity extends Activity {
	
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
       
        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
        setContentView(R.layout.main_menu);
		getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE,
				R.layout.title_bar);
        
        Bundle bundle = this.getIntent().getExtras();
        final String parametro = bundle.getString("ID");

        Button b_salir=(Button)findViewById(R.id.MM_Log_out_B);
        Button b_reservacion=(Button)findViewById(R.id.MM_Do_reservation_B);
        Button b_milista=(Button)findViewById(R.id.MM_My_Reservation_B);
        Button b_preferencias=(Button)findViewById(R.id.MM_Preferences_B);
        b_reservacion.setOnClickListener(new OnClickListener() {
			
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(getApplicationContext(),
	                        DoReservationActivity.class);
				Bundle bundle = new Bundle();
				bundle.putString("ID", parametro);
				i.putExtras(bundle);
                startActivity(i);
				
			}
		});
        b_milista.setOnClickListener(new OnClickListener() {
			
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(getApplicationContext(),
                        MiReservationActivity.class);
				Bundle bundle = new Bundle();
				bundle.putString("ID", parametro);
				i.putExtras(bundle);
                startActivity(i);
				
			}
		});
        b_salir.setOnClickListener(new OnClickListener() {			
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				finish();
			}
		});
        b_preferencias.setOnClickListener(new OnClickListener() {
			
			public void onClick(View v) {
				// TODO Auto-generated method stub
				Intent i = new Intent(getApplicationContext(),
                        PreferencesActivity.class);
                startActivity(i);
			}
		});
        
        
	}
}
